package com.carkeeper.service.serviceFallback;

import com.carkeeper.dto.CUserDTO;
import com.carkeeper.service.CUserFeign;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * C端用户-微服务接口Fallback
 */
@Component
public class CUserFallbackFactory implements FallbackFactory<CUserFeign> {
    @Override
    public CUserFeign create(Throwable throwable) {
        return new CUserFeign() {
            @Override
            public CUserDTO findById(Long id) {
                return null;
            }

            @Override
            public List<CUserDTO> findAll(CUserDTO dto) {
                return new ArrayList<>();
            }
        };
    }
}
